package ming.model.type;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.StringUtils;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

 
@SuppressWarnings("serial")
@Entity
@Table(name = "T_BASEDATA_GROUPTYPE", schema = "")
@DynamicInsert(true)
@DynamicUpdate(true)
public class GroupType implements java.io.Serializable {

	private String path;// 此属性不存数据库，虚拟属性
	// Fields
	
	private String id;
	private String name;
	private String code;
	private int state;
	private String createtime;

	@Id
	@Column(name = "ID", unique = true, nullable = false, length = 36)
	public String getId() {
		if (!StringUtils.isBlank(this.id)) {
			return this.id;
		}
		return UUID.randomUUID().toString();
	}

	public void setId(String id) {
		this.id = id;
	}
	
	

	@Transient
	public String getPath() {
		return path;
	}
	
	@Column(name = "name", length = 100)
	public String getName() {
		return name;
	}

	@Column(name = "code", length = 100)
	public String getCode() {
		return code;
	}

	@Column(name = "state")
	public int getState() {
		return state;
	}

	@Column(name = "createtime", length = 100)
	public String getCreatetime() {
		return createtime;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setState(int state) {
		this.state = state;
	}

	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

	public void setPath(String path) {
		this.path = path;
	}


}